package model

import (
	"day11/video-mngr/video-server/basic/config"
	"gorm.io/gorm"
)

type Video struct {
	gorm.Model
	Title    string `gorm:"type:varchar(30);comment:标题"`
	Status   string `gorm:"type:varchar(30);comment:状态"`
	VideoUrl string `gorm:"type:varchar(255);comment:视频地址"`
}

func CreateVideo(v *Video) error {

	return config.DB.Create(&v).Error
}

type Drama struct {
	gorm.Model
	VideoId int    `gorm:"type:int(11);comment:视频ID"`
	Title   string `gorm:"type:varchar(30);comment:标题"`
	Address string `gorm:"type:varchar(30);comment:发布地区"`
	Count   int    `gorm:"type:int(11);comment:播放量"`
	Vip     string `gorm:"type:varchar(20);comment:是否付费"`
}

func CreateDrama(d *Drama) error {

	return config.DB.Create(&d).Error
}
